﻿using System.Collections.Generic;
using System.Linq;

namespace GarageManagement.Startup
{
    public class Bootstrapper
    {
        private readonly IEnumerable<BootstrapperStep> steps;

        public Bootstrapper(IEnumerable<BootstrapperStep> steps)
        {
            this.steps = steps;
        }

        public void Execute()
        {
            foreach (var bootstrapperStep in steps.OrderBy(x => x.ExecutionOrder))
            {
                bootstrapperStep.Execute();
            }
        }
    }
}
